package com.witmore.neutron.ai.web.controller;

import com.witmore.neutron.ai.web.config.WebSocketProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * WebSocket配置Controller
 * Author: 豆子高
 * Date: 2025/1/3
 */
@RestController
@RequestMapping("/api/websocket")
public class WebSocketConfigController {
    
    @Autowired
    private WebSocketProperties webSocketProperties;
    
    /**
     * 获取WebSocket配置
     */
    @GetMapping("/config")
    public Map<String, String> getWebSocketConfig() {
        Map<String, String> config = new HashMap<>();
        config.put("websocketUrl", webSocketProperties.getWebsocketUrl());
        config.put("domain", webSocketProperties.getDomain());
        return config;
    }
}
